﻿@model IEnumerable<Tecnosop.WebUI.Models.EquipoEnConvenioViewModel>
@*@using (Html.BeginCollectionItem)*@
@(Html.Telerik().Grid(Model)
    .Name("Equipos_en_convenio")
    .DataKeys(keys => keys.Add(k => k.IdEquipo))
    .DataBinding(binds => binds.Ajax()
        .Select(MVC.Convenio._AjaxGridBindingSelect().GetRouteValueDictionary())
        .Insert(MVC.Convenio._AjaxGridBindingAdd().GetRouteValueDictionary())
        .Update(MVC.Convenio._AjaxGridBindingEdit().GetRouteValueDictionary())
        .Delete(MVC.Convenio._AjaxGridBindingDelete().GetRouteValueDictionary()))
    .ToolBar(tbar =>
        {
            tbar.Position(GridToolBarPosition.Top);
            tbar.Insert()
                .ButtonType(GridButtonType.ImageAndText)
                .HtmlAttributes(new { @class = "nice radius verysmall green button" });
        })
    .Columns(cols =>
        {
            cols.Bound(e => e.IdEquipo)
                .Width(100)
                .Sortable(true);
            cols.Bound(e => e.Tipo)
                .Sortable(false);
            cols.Command(comm =>
                {
                    comm.Edit()
                        .ButtonType(GridButtonType.ImageAndText)
                        .HtmlAttributes(new { @class = "nice radius verysmall red button" });
                    comm.Delete()
                        .ButtonType(GridButtonType.ImageAndText)
                        .HtmlAttributes(new { @class = "nice radius verysmall red button" });
                }).Width(150);
        })
    .Editable(ed => ed.Mode(GridEditMode.InLine))
    .Scrollable(c => c.Height(75))
    .Sortable()
    .PrefixUrlParameters(false)
)